<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>SphericalCoordinates (Apache Commons Math 3.3 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="SphericalCoordinates (Apache Commons Math 3.3 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SphericalCoordinates.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphereGenerator.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SubLine.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html" target="_top">Frames</a></li>
<li><a href="SphericalCoordinates.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.math3.geometry.euclidean.threed</div>
<h2 title="Class SphericalCoordinates" class="title">Class SphericalCoordinates</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.math3.geometry.euclidean.threed.SphericalCoordinates</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">SphericalCoordinates</span>
extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block">This class provides conversions related to <a
 href="http://mathworld.wolfram.com/SphericalCoordinates.html">spherical coordinates</a>.
 <p>
 The conventions used here are the mathematical ones, i.e. spherical coordinates are
 related to Cartesian coordinates as follows:
 </p>
 <ul>
   <li>x = r cos(&theta;) sin(&Phi;)</li>
   <li>y = r sin(&theta;) sin(&Phi;)</li>
   <li>z = r cos(&Phi;)</li>
 </ul>
 <ul>
   <li>r       = &radic;(x<sup>2</sup>+y<sup>2</sup>+z<sup>2</sup>)</li>
   <li>&theta; = atan2(y, x)</li>
   <li>&Phi;   = acos(z/r)</li>
 </ul>
 <p>
 r is the radius, &theta; is the azimuthal angle in the x-y plane and &Phi; is the polar
 (co-latitude) angle. These conventions are <em>different</em> from the conventions used
 in physics (and in particular in spherical harmonics) where the meanings of &theta; and
 &Phi; are reversed.
 </p>
 <p>
 This class provides conversion of coordinates and also of gradient and Hessian
 between spherical and Cartesian coordinates.
 </p></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>3.2</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: SphericalCoordinates.java 1443364 2013-02-07 09:28:04Z luc $</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../serialized-form.html#org.apache.commons.math3.geometry.euclidean.threed.SphericalCoordinates">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#SphericalCoordinates(double, double, double)">SphericalCoordinates</a></strong>(double&nbsp;r,
                    double&nbsp;theta,
                    double&nbsp;phi)</code>
<div class="block">Build a spherical coordinates transformer from spherical coordinates.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#SphericalCoordinates(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">SphericalCoordinates</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a>&nbsp;v)</code>
<div class="block">Build a spherical coordinates transformer from Cartesian coordinates.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getCartesian()">getCartesian</a></strong>()</code>
<div class="block">Get the Cartesian coordinates.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getPhi()">getPhi</a></strong>()</code>
<div class="block">Get the polar (co-latitude) angle.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getR()">getR</a></strong>()</code>
<div class="block">Get the radius.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getTheta()">getTheta</a></strong>()</code>
<div class="block">Get the azimuthal angle in x-y plane.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#toCartesianGradient(double[])">toCartesianGradient</a></strong>(double[]&nbsp;sGradient)</code>
<div class="block">Convert a gradient with respect to spherical coordinates into a gradient
 with respect to Cartesian coordinates.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[][]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#toCartesianHessian(double[][], double[])">toCartesianHessian</a></strong>(double[][]&nbsp;sHessian,
                  double[]&nbsp;sGradient)</code>
<div class="block">Convert a Hessian with respect to spherical coordinates into a Hessian
 with respect to Cartesian coordinates.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="SphericalCoordinates(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SphericalCoordinates</h4>
<pre>public&nbsp;SphericalCoordinates(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a>&nbsp;v)</pre>
<div class="block">Build a spherical coordinates transformer from Cartesian coordinates.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>v</code> - Cartesian coordinates</dd></dl>
</li>
</ul>
<a name="SphericalCoordinates(double, double, double)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SphericalCoordinates</h4>
<pre>public&nbsp;SphericalCoordinates(double&nbsp;r,
                    double&nbsp;theta,
                    double&nbsp;phi)</pre>
<div class="block">Build a spherical coordinates transformer from spherical coordinates.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - radius</dd><dd><code>theta</code> - azimuthal angle in x-y plane</dd><dd><code>phi</code> - polar (co-latitude) angle</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="getCartesian()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCartesian</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a>&nbsp;getCartesian()</pre>
<div class="block">Get the Cartesian coordinates.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Cartesian coordinates</dd></dl>
</li>
</ul>
<a name="getR()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getR</h4>
<pre>public&nbsp;double&nbsp;getR()</pre>
<div class="block">Get the radius.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>radius r</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getTheta()"><code>getTheta()</code></a>, 
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getPhi()"><code>getPhi()</code></a></dd></dl>
</li>
</ul>
<a name="getTheta()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTheta</h4>
<pre>public&nbsp;double&nbsp;getTheta()</pre>
<div class="block">Get the azimuthal angle in x-y plane.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>azimuthal angle in x-y plane &theta;</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getR()"><code>getR()</code></a>, 
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getPhi()"><code>getPhi()</code></a></dd></dl>
</li>
</ul>
<a name="getPhi()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPhi</h4>
<pre>public&nbsp;double&nbsp;getPhi()</pre>
<div class="block">Get the polar (co-latitude) angle.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>polar (co-latitude) angle &Phi;</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getR()"><code>getR()</code></a>, 
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html#getTheta()"><code>getTheta()</code></a></dd></dl>
</li>
</ul>
<a name="toCartesianGradient(double[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toCartesianGradient</h4>
<pre>public&nbsp;double[]&nbsp;toCartesianGradient(double[]&nbsp;sGradient)</pre>
<div class="block">Convert a gradient with respect to spherical coordinates into a gradient
 with respect to Cartesian coordinates.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sGradient</code> - gradient with respect to spherical coordinates
 {df/dr, df/d&theta;, df/d&Phi;}</dd>
<dt><span class="strong">Returns:</span></dt><dd>gradient with respect to Cartesian coordinates
 {df/dx, df/dy, df/dz}</dd></dl>
</li>
</ul>
<a name="toCartesianHessian(double[][], double[])">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toCartesianHessian</h4>
<pre>public&nbsp;double[][]&nbsp;toCartesianHessian(double[][]&nbsp;sHessian,
                            double[]&nbsp;sGradient)</pre>
<div class="block">Convert a Hessian with respect to spherical coordinates into a Hessian
 with respect to Cartesian coordinates.
 <p>
 As Hessian are always symmetric, we use only the lower left part of the provided
 spherical Hessian, so the upper part may not be initialized. However, we still
 do fill up the complete array we create, with guaranteed symmetry.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sHessian</code> - Hessian with respect to spherical coordinates
 {{d<sup>2</sup>f/dr<sup>2</sup>, d<sup>2</sup>f/drd&theta;, d<sup>2</sup>f/drd&Phi;},
  {d<sup>2</sup>f/drd&theta;, d<sup>2</sup>f/d&theta;<sup>2</sup>, d<sup>2</sup>f/d&theta;d&Phi;},
  {d<sup>2</sup>f/drd&Phi;, d<sup>2</sup>f/d&theta;d&Phi;, d<sup>2</sup>f/d&Phi;<sup>2</sup>}</dd><dd><code>sGradient</code> - gradient with respect to spherical coordinates
 {df/dr, df/d&theta;, df/d&Phi;}</dd>
<dt><span class="strong">Returns:</span></dt><dd>Hessian with respect to Cartesian coordinates
 {{d<sup>2</sup>f/dx<sup>2</sup>, d<sup>2</sup>f/dxdy, d<sup>2</sup>f/dxdz},
  {d<sup>2</sup>f/dxdy, d<sup>2</sup>f/dy<sup>2</sup>, d<sup>2</sup>f/dydz},
  {d<sup>2</sup>f/dxdz, d<sup>2</sup>f/dydz, d<sup>2</sup>f/dz<sup>2</sup>}}</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SphericalCoordinates.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SphereGenerator.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/SubLine.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/geometry/euclidean/threed/SphericalCoordinates.html" target="_top">Frames</a></li>
<li><a href="SphericalCoordinates.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2003&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
